package com.huayue.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huayue.dao.BaseDao;
import com.huayue.dao.RoomTypeDao;
import com.huayue.entity.Reserve;
import com.huayue.entity.RoomType;
import com.huayue.util.PageHelper;

/**
 * 房间类型
 */
@Service
public class RoomTypeService extends BaseService<RoomType> {
    @Autowired
    RoomTypeDao room_typeDao;

    @Override
    public BaseDao<RoomType> getDao() {
        return room_typeDao;
    }

    public List<Map<String, Object>> findRoom_product_type() {
        return room_typeDao.findRoom_product_type();
    }

    /**
     * 修改网站Logo 传入id和Logo的地址
     *
     * @param roomType
     * @return
     */
    public int updateIcon(RoomType roomType) {
        return room_typeDao.updateIcon(roomType);
    }

    public List<Map<String, Object>> findAvailableAll() {
        return room_typeDao.findAvailableAll();
    }

    public List<Map<String, Object>> findRoomType(Reserve reserve, Integer roomTypeId) {
        return room_typeDao.findAvailRoom(reserve, roomTypeId);
    }

    public List<Map<String, Object>> findTotalPrice(PageHelper pageHelper, RoomType roomType, String begin,
        String end) {
        return room_typeDao.findTotalPrice(pageHelper, roomType, begin, end);
    }

    public int findTotalPriceCount(RoomType roomType, String begin, String end) {
        return room_typeDao.findTotalPriceCount(roomType, begin, end);
    }
}
